#include <iostream>

int main() {
    int a = 0, b = 0, c = 0;
    for (int i = 999; i >= 100; i--) {
        a = i / 100;
        b = (i - a * 100) / 10;
        c = i - a * 100 - b * 10;
        if ((a * a * a + b * b * b + c * c * c) == i) {
            std::cout << i << std::endl;
        }
    }
    return 0;
}